package top.jybill.domain;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

import java.util.HashMap;
import java.util.Map;

@Component
public class ResponseData {

  private Map<String, Object> data = new HashMap<>();
  private Map<String, Object> meta = new HashMap<>();

  public Map<String, Object> getData() {
    return data;
  }

  public void setData(Map<String, Object> data) {
    this.data = data;
  }

  public Map<String, Object> getMeta() {
    return meta;
  }

  public void setMeta(Map<String, Object> meta) {
    this.meta = meta;
  }

  public void clean() {
    data = new HashMap<>();
    meta = new HashMap<>();
  }

  public void setDateMeta(Map<String, Object> d, Map<String, Object> m) {
    data = d;
    meta = m;
  }

  public void dataPut(String s, Object v) {
    data.put(s, v);
  }

  public void metaPut(String s, Object v) {
    meta.put(s, v);
  }

  @Override
  public String toString() {
    return "ResponseData{" +
            "data=" + data +
            ", meta=" + meta +
            '}';
  }
}
